#include <iostream>
#include <string>

using namespace std;

string week[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};

int day(int y, int m, int d) {
    int ans = 0;
    for(int i = 1; i < y; i++) {
        // 判断第 i 年是平年还是闰年
        if((i%4==0 && i%100!=0) || (i%400==0)) {
            ans += 366%7;
            ans %= 7;
        } else {
            ans += 365 % 7;
            ans %= 7;
        }
    }

    // 统计月份
    for(int i = 1; i < m; i++) {
        if(1 == i || 3 == i || 5 == i || 7 == i || 8 == i || 10 == i || 12 == i) {
            ans += 31 % 7;
            ans %= 7;
        } else if(4 == i || 6 == i || 9 == i || 11 == i) {
            ans += 30 % 7;
            ans %= 7;
        } else if((y%4==0 && y%100!=0) || (y%400==0)) {
            ans += 29 % 7;
            ans %= 7;
        } else {
            ans += 28 % 7;
            ans %= 7;
        }
    }

    ans += (d - 1) % 7;
    ans %= 7;
    
    return ans;
}

int main()
{
    int y, m, d;

    cin >> y >> m >> d;

    cout << week[day(y, m, d)] << endl;    

    return 0;
}

